package com.diyizu.youdianda.serviceImpl;

import com.diyizu.youdianda.entity.SysUser;
import com.diyizu.youdianda.mapper.SysUserMapper;
import com.diyizu.youdianda.service.YddIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

@Service
public class YddIndexServiceImpl implements YddIndexService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public boolean registerUser(String moible, String password) {
        SysUser sysUser = new SysUser();
        sysUser.setPhone(moible);
        // 加密
        String s = DigestUtils.md5DigestAsHex(password.getBytes(StandardCharsets.UTF_8));
        sysUser.setPassword(s);

        return true;
    }
}
